using System;
using System.Data;
using System.Collections;

namespace APP.QUANLY.Entity
{
     /// <summary>
     /// Summary description for CA.
     /// </summary>
     public class CA
    {
              private Int32 _MACA;
      private Int32 _MANHANVIEN;
      private DateTime _NGAYBATDAU;
      private DateTime _NGAYKETTHUC;
      private string _GHICHU;
      private bool _BATDAUCA;
      private HOADONNHAPKHOList _listHOADONNHAPKHO;
      private HOADONXUATKHOList _listHOADONXUATKHO;
      private PHIEUCHIList _listPHIEUCHI;
      private PHIEUTHUList _listPHIEUTHU;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
		      public bool IsMACANullable
      { get { return false;  } }
      public Int32 MACA
      {
         get { return _MACA; }
         set { _MACA = value; }
      }
      public bool IsMANHANVIENNullable
      { get { return true;  } }
      public Int32 MANHANVIEN
      {
         get { return _MANHANVIEN;  }
         set { _MANHANVIEN = value; }
      }
      public bool IsNGAYBATDAUNullable
      { get { return true;  } }
      public DateTime NGAYBATDAU
      {
         get { return _NGAYBATDAU;  }
         set { _NGAYBATDAU = value; }
      }
      public bool IsNGAYKETTHUCNullable
      { get { return true;  } }
      public DateTime NGAYKETTHUC
      {
         get { return _NGAYKETTHUC;  }
         set { _NGAYKETTHUC = value; }
      }
      public bool IsGHICHUNullable
      { get { return true;  } }
      public string GHICHU
      {
         get { return _GHICHU;  }
         set { _GHICHU = value; }
      }
      public bool IsBATDAUCANullable
      { get { return true;  } }
      public bool BATDAUCA
      {
         get { return _BATDAUCA;  }
         set { _BATDAUCA = value; }
      }
public HOADONNHAPKHOList HOADONNHAPKHOList 
{ 
	get { return _listHOADONNHAPKHO; }
	set { _listHOADONNHAPKHO = value;}
}
public HOADONXUATKHOList HOADONXUATKHOList 
{ 
	get { return _listHOADONXUATKHO; }
	set { _listHOADONXUATKHO = value;}
}
public PHIEUCHIList PHIEUCHIList 
{ 
	get { return _listPHIEUCHI; }
	set { _listPHIEUCHI = value;}
}
public PHIEUTHUList PHIEUTHUList 
{ 
	get { return _listPHIEUTHU; }
	set { _listPHIEUTHU = value;}
}

        #endregion

        #region Constructors
        public CA()
        {
            Reset();
        }
        public CA(CA obj)
        {
            	this._MACA = obj.MACA;
	this._MANHANVIEN = obj.MANHANVIEN;
	this._NGAYBATDAU = obj.NGAYBATDAU;
	this._NGAYKETTHUC = obj.NGAYKETTHUC;
	this._GHICHU = obj.GHICHU;
	this._BATDAUCA = obj.BATDAUCA;
        }
        #endregion

        public void Reset()
        {
                     _MACA = EmptyValues.v_Int32;
         _MANHANVIEN = EmptyValues.v_Int32;
         _NGAYBATDAU = EmptyValues.v_DateTime;
         _NGAYKETTHUC = EmptyValues.v_DateTime;
         _GHICHU = EmptyValues.v_string;
         _BATDAUCA = EmptyValues.v_bool;
	_listHOADONNHAPKHO = null;
	_listHOADONXUATKHO = null;
	_listPHIEUCHI = null;
	_listPHIEUTHU = null;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["MACA"] is DBNull))
		{
			obj.MACA = (Int32)reader["MACA"];
		}
                if(!(reader["MANHANVIEN"] is DBNull))
		{
			obj.MANHANVIEN = (Int32)reader["MANHANVIEN"];
		}
                if(!(reader["NGAYBATDAU"] is DBNull))
		{
			obj.NGAYBATDAU = (DateTime)reader["NGAYBATDAU"];
		}
                if(!(reader["NGAYKETTHUC"] is DBNull))
		{
			obj.NGAYKETTHUC = (DateTime)reader["NGAYKETTHUC"];
		}
                if(!(reader["GHICHU"] is DBNull))
		{
			obj.GHICHU = (string)reader["GHICHU"];
		}
                if(!(reader["BATDAUCA"] is DBNull))
		{
			obj.BATDAUCA = (bool)reader["BATDAUCA"];
		}
//            _MACA = (reader["MACA"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["MACA"];
//            _MANHANVIEN = (reader["MANHANVIEN"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["MANHANVIEN"];
//            _NGAYBATDAU = (reader["NGAYBATDAU"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["NGAYBATDAU"];
//            _NGAYKETTHUC = (reader["NGAYKETTHUC"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["NGAYKETTHUC"];
//            _GHICHU = (reader["GHICHU"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["GHICHU"];
//            _BATDAUCA = (reader["BATDAUCA"] is DBNull)?DalTools.EmptyValues.v_bool:(bool)reader["BATDAUCA"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(Int32 MACA, Int32 MANHANVIEN, DateTime NGAYBATDAU, DateTime NGAYKETTHUC, string GHICHU, bool BATDAUCA)
        {
                     this._MACA = MACA;
         this._MANHANVIEN = MANHANVIEN;
         this._NGAYBATDAU = NGAYBATDAU;
         this._NGAYKETTHUC = NGAYKETTHUC;
         this._GHICHU = GHICHU;
         this._BATDAUCA = BATDAUCA;
        }
    }
}